<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
        #golist {display: none;}
        @media (max-device-width: 780px){#golist{display: block !important;}}
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?type=quick&ak=LOoFXO0NxsgLd6BgTjGxb2ZD&v=1.0"></script>
    <title></title>
</head>
<body>
<div id="allmap"></div>
<script type="text/javascript">

    var name = getQueryString('name');
    var lon = getQueryString('lon');
    var lat = getQueryString('lat');

    document.title = name;

    // 百度地图API功能
    var map = new BMap.Map("allmap");
    map.centerAndZoom(new BMap.Point(lon, lat), 18);

    map.addControl(new BMap.ZoomControl());  //添加地图缩放控件
    var marker1 = new BMap.Marker(new BMap.Point(lon, lat));  //创建标注
    map.addOverlay(marker1);                 // 将标注添加到地图中
    //创建信息窗口
    //var infoWindow1 = new BMap.InfoWindow(name);
    //marker1.addEventListener("click", function(){this.openInfoWindow(infoWindow1);});

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
        var context = "";
        if (r != null){
            context = r[2];
            reg = null;
            r = null;
        }
        return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);

    }
</script>
</body>
</html>
